#ifndef stars_hpp
#define stars_hpp

#include <GL/glut.h>
// ????
#define SUN_RADIUS 48.74
#define MER_RADIUS  7.32
#define VEN_RADIUS 18.15
#define EAR_RADIUS 19.13
#define MOO_RADIUS  6.15
#define MAR_RADIUS 10.19
#define JUP_RADIUS 42.90
#define SAT_RADIUS 36.16
#define URA_RADIUS 25.56
#define NEP_RADIUS 24.78

// ??????
#define MER_DIS   62.06
#define VEN_DIS  115.56
#define EAR_DIS  168.00
#define MOO_DIS   26.01
#define MAR_DIS  228.00
#define JUP_DIS  333.40
#define SAT_DIS  428.10
#define URA_DIS 848.00
#define NEP_DIS 949.10

// ????
#define MER_SPEED   87.0
#define VEN_SPEED  225.0
#define EAR_SPEED  365.0
#define MOO_SPEED   30.0
#define MAR_SPEED  687.0
#define JUP_SPEED 1298.4
#define SAT_SPEED 3225.6
#define URA_SPEED 3066.4
#define NEP_SPEED 6014.8

// ????
#define SELFROTATE 3

// ?????????????????????
#define SET_VALUE_3(name, value0, value1, value2) \
                   ((name)[0])=(value0), ((name)[1])=(value1), ((name)[2])=(value2)




class Star{
public:
    GLfloat radius;
    GLfloat speed,selfSpeed;
    GLfloat distance;
    GLfloat rgbaColor[4];
    GLfloat test;
    Star* parentStar;
    Star(GLfloat Radius, GLfloat Distance,
        GLfloat Speed,  GLfloat SelfSpeed,
        Star* ParentStar);
    void drawStar();
    virtual void update(long timeSpan);
    virtual void draw(){drawStar();}
protected:
    GLfloat alphaSelf,alpha;
};

class Planet:public Star{
public:
    Planet(GLfloat Radius, GLfloat Distance,
        GLfloat Speed,  GLfloat SelfSpeed,
        Star* ParentStar, GLfloat rgbColor[]);
    void drawPlanet();
    virtual void draw(){drawPlanet();drawStar();}

};

class LightPlanet:public Planet{
public:
    LightPlanet(GLfloat Radius, GLfloat Distance,
        GLfloat Speed,  GLfloat SelfSpeed,
        Star* ParentStar, GLfloat rgbColor[]);
    void drawLight();
    virtual void draw(){drawLight();drawPlanet();drawStar();}
};

#endif
